import { EntityModel } from '@midwayjs/orm';
import { Column } from 'typeorm';
import { BaseModel } from '../utils/base.model';

export enum PeopleCheckStatus {
  // 初始状态
  NORMAL = 'normal',
  // 核验成功
  SUCCESS = 'success',
  // 待人工核验
  PENDING = 'pending',
  // 核验失败
  FAIL = 'fail',
}

/**
 * 人员核验
 */
@EntityModel()
export class PeopleCheck extends BaseModel {
  @Column({
    comment: '名称',
    nullable: true,
  })
  name: string;

  @Column({
    comment: '身份证',
    nullable: true,
  })
  idcard: string;

  @Column({
    comment: '手机号码',
    nullable: true,
  })
  mobile: string;

  @Column({
    comment: '身份证正面照片',
    nullable: true,
  })
  idcardFrontImage: string;

  @Column({
    comment: '身份证反面照片',
    nullable: true,
  })
  idcardBackImage: string;

  @Column({
    comment: '拍摄人像照片',
    nullable: true,
  })
  photo: string;

  @Column({
    type: 'enum',
    enum: PeopleCheckStatus,
    default: PeopleCheckStatus.NORMAL,
    comment: '核验状态',
  })
  status: PeopleCheckStatus;
}
